package com.im.partchat.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;

import com.im.partchat.R;
import com.im.partchat.adapter.base.XRecyclerViewAdapter;
import com.im.partchat.adapter.base.XViewHolder;
import com.im.partchat.bean.more.DocBean;

import java.util.List;

/**
 * Created by flyou on 2017/6/30.
 * VersionCode: 1
 * Desc:
 */

public class DocDownAdapter extends XRecyclerViewAdapter<DocBean> {
    private Context context;

    public DocDownAdapter(Context context, @NonNull RecyclerView mRecyclerView, List<DocBean> dataLists) {
        super(mRecyclerView, dataLists, R.layout.view_doc_item);
        this.context = context;
    }

    @Override
    protected void bindData(XViewHolder holder, DocBean data, int position) {
        holder.setText(R.id.doc_name, data.getTitle());
        int ststus = data.getStstus();
        if (ststus ==0) {
            holder.setVisible(R.id.download_status, false);
        }else if (ststus==1){
            holder.setVisible(R.id.download_status, true);
            holder.setText(R.id.download_status,"点击打开");
        }else {
            holder.setVisible(R.id.download_status, true);
            holder.setText(R.id.download_status,"下载中……");
        }


    }
}
